# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Ben <ben@benmazer.net>

pkgname=gmime
pkgver=2.6.23+4+g91dcee38
pkgrel=1
pkgdesc="Glorious MIME Utility Library"
arch=(i686 x86_64)
license=(GPL)
url="http://spruce.sourceforge.net/gmime/"
depends=(glib2 gpgme zlib)
makedepends=(gtk-sharp-2 gobject-introspection gtk-doc git vala docbook-utils)
_commit=91dcee38ea301463fb9c6bc936f08b9fd1c0969f  # gmime-2-6
source=("git+https://git.gnome.org/browse/gmime#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  # get rid of that .wapi errors in fakeroot
  export MONO_SHARED_DIR="$srcdir/weird"
  mkdir -p "$MONO_SHARED_DIR"

  cd "$pkgname"

  ./configure --prefix=/usr \
    --program-prefix=$pkgname \
    --enable-gtk-doc \
    --enable-mono \
    --enable-smime \
    --disable-static

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd "$pkgname"
  make DESTDIR="$pkgdir" install
}
